import request from '@/utils/request'

export function createWarehouse(data) {
  return request({
    url: '/admin/leaves/warehouse/createWarehouse',
    method: 'post',
    data
  })
}

export function deleteWarehouse(id) {
  return request({
    url: `/admin/leaves/warehouse/deleteWarehouse/${id}`,
    method: 'delete'
  })
}

export function updateWarehouse(warehouseInfo) {
  return request({
    url: '/admin/leaves/warehouse/updateWarehouse',
    method: 'put',
    data: warehouseInfo
  })
}

export function getWarehouse(id) {
  return request({
    url: `/admin/leaves/warehouse/getWarehouse/${id}`,
    method: 'get'
  })
}

export function getWarehouseList(searchObj) {
  return request({
    url: '/admin/leaves/warehouse/getWarehouseList',
    method: 'post',
    data: searchObj
  })
}
